package com.shj.service.impl;

import com.shj.dao.SysChronicPaperMapper;
import com.shj.entity.SysChronicPaper;
import com.shj.entity.SysChronicdis;
import com.shj.service.SysChronicdisService;
import com.shj.service.SysPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author songhuajian
 * @Description: TODO
 * @date 2020/6/17 15:31
 **/
@Service
public class SysPaperServiceImpl implements SysPaperService {

    @Autowired
    private SysChronicPaperMapper sysChronicPaperMapper;

    @Override
    public List<SysChronicPaper> findAll() {
        return sysChronicPaperMapper.findAll();
    }

    @Override
    public SysChronicPaper findById(Integer id) {
        return sysChronicPaperMapper.selectByPrimaryKey(id);
    }

    @Override
    public SysChronicPaper equalChName(String perCode, String chName) {
        return sysChronicPaperMapper.equalChName(perCode, chName);
    }

    @Override
    public void add(SysChronicPaper sysChronicPaper) {
        sysChronicPaperMapper.insert(sysChronicPaper);
    }

    @Override
    public void edit(SysChronicPaper sysChronicPaper) {
        sysChronicPaperMapper.updateByPrimaryKey(sysChronicPaper);
    }

    @Override
    public void delete(Integer id) {
        sysChronicPaperMapper.deleteByPrimaryKey(id);
    }
}
